'use strict'


//const fun = require('./function.js');

class dailypoem {
  constructor() {
    this.param = '/'
  }

  async get(c) {
    let {search_text} = c.query
    let a = c.service.fun;

    c.setHeader('content-type', 'text/html; charset=utf-8')
    let jieqi = await a.sel('jieqi_list',{'jieqi_name':search_text},["jieqi_name","jieqi_brief","jieqi_type","jieqi_season","jieqi_img"],c.service.pool)

    let poem =await a.sel('poem_list',{'jieqi_name':search_text},["poem_name","poet","poem_txt"],c.service.pool);

    let data = [...jieqi.rows,...poem.rows]
    c.send({
      type:'object',
      data:data
    })
  }
 
}

module.exports = dailypoem;

